<?php

return array(
	'ctrl' => array(
		'label' => 'title',
		'default_sortby' => 'ORDER BY title',
		'tstamp' => 'tstamp',
		'prependAtCopy' => 'LLL:EXT:lang/locallang_general.xml:LGL.prependAtCopy',
		'title' => 'LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group',
		'delete' => 'deleted',
		'iconfile' => TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('direct_mail') . 'res/gfx/mailgroup.gif',
		'type' => 'type',
	),
	'interface' => array(
		'showRecordFieldList' => 'type,title,description'
	),
	'columns' => array(
		'title' => array(
			'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.title',
			'config' => array(
				'type' => 'input',
				'size' => '30',
				'max' => '120',
				'eval' => 'trim,required'
			)
		),
		'description' => array(
			'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.description',
			'config' => array(
				'type' => 'text',
				'cols' => '40',
				'rows' => '3'
			)
		),
		'type' => array(
			'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.type',
			'config' => array(
				'type' => 'select',
				'items' => array(
					array('LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.type.I.0', '0'),
					array('LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.type.I.1', '1'),
					array('LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.type.I.2', '2'),
					array('LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.type.I.3', '3'),
					array('LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.type.I.4', '4')
				),
				'default' => '0'
			)
		),
		'static_list' => array(
			'label' => 'LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.static_list',
			'config' => array(
				'type' => 'group',
				'internal_type' => 'db',
				'allowed' => 'tt_address,fe_users,fe_groups',
				'MM' => 'sys_dmail_group_mm',
				'size' => '20',
				'maxitems' => '100000',
				'minitems' => '0',
				'show_thumbs' => '1'
			)
		),
		'pages' => array(
			'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.startingpoint',
			'config' => array(
				'type' => 'group',
				'internal_type' => 'db',
				'allowed' => 'pages',
				'size' => '3',
				'maxitems' => '22',
				'minitems' => '0',
				'show_thumbs' => '1'
			)
		),
		'mail_groups' => array(
			'label' => 'LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.mail_groups',
			'config' => array(
				'type' => 'group',
				'internal_type' => 'db',
				'allowed' => 'sys_dmail_group',
				'size' => '3',
				'maxitems' => '22',
				'minitems' => '0',
				'show_thumbs' => '1'
			)
		),
		'recursive' => array(
			'label' => 'LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.recursive',
			'config' => array(
				'type' => 'check'
			)
		),
		'whichtables' => array(
			'label' => 'LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.whichtables',
			'config' => array(
				'type' => 'check',
				'items' => array(
					array('LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.whichtables.I.0', ''),
					array('LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.whichtables.I.1', ''),
					array('LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.whichtables.I.2', ''),
					array('LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.whichtables.I.3', ''),
				),
				'cols' => 2,
				'default' => 1
			)
		),
		'list' => array(
			'label' => 'LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.list',
			'config' => array(
				'type' => 'text',
				'cols' => '48',
				'rows' => '10'
			)
		),
		'csv' => array(
			'label' => 'LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.csv',
			'config' => array(
				'type' => 'select',
				'items' => array(
					array('LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.csv.I.0', '0'),
					array('LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.csv.I.1', '1')
				),
				'default' => '0'
			)
		),
		'select_categories' => array(
			'label' => 'LLL:EXT:direct_mail/locallang_tca.xml:sys_dmail_group.select_categories',
			'config' => array(
				'type' => 'select',
				'foreign_table' => 'sys_dmail_category',
				'foreign_table_where' => 'AND sys_dmail_category.l18n_parent=0 AND sys_dmail_category.pid IN (###PAGE_TSCONFIG_IDLIST###) ORDER BY sys_dmail_category.sorting',
				'itemsProcFunc' => '\DirectMailTeam\DirectMail\SelectCategories->get_localized_categories',
				'itemsProcFunc_config' => array(
					'table' => 'sys_dmail_category',
					'indexField' => 'uid',
				),
				'size' => 5,
				'minitems' => 0,
				'maxitems' => 60,
				'renderMode' => 'checkbox',
				'MM' => 'sys_dmail_group_category_mm',
			)
		)

	),
	'types' => array(
		'0' => array('showitem' => 'type;;;;1-1-1, title;;;;3-3-3, description, --div--,pages;;;;5-5-5,recursive,whichtables,select_categories'),
		'1' => array('showitem' => 'type;;;;1-1-1, title;;;;3-3-3, description, --div--,list;;;;5-5-5,csv'),
		'2' => array('showitem' => 'type;;;;1-1-1, title;;;;3-3-3, description, --div--,static_list;;;;5-5-5'),
		'3' => array('showitem' => 'type;;;;1-1-1, title;;;;3-3-3, description'),
		'4' => array('showitem' => 'type;;;;1-1-1, title;;;;3-3-3, description, --div--,mail_groups;;;;5-5-5')
	)
);